<template>
	<view>
		<view class="u-page">

			<view class="top-box">
				<!-- 背景图 -->
				<view class="top-color">
					<image src="../../static/index/banner.png" mode="widthFix" style="width: 100%;height: 100%;">
					</image>
				</view>
				<!-- 轮播图 -->
				<x-swiper :swiperList="swiperList"></x-swiper>
			</view>
			<view class="print bg-ffshow">
				<!-- 打印title -->
				<!-- 打印功能的板块显示 -->
				<x-banner :printList="printList" modebool='widthFix' @clickPrint="switchPrint">
					<x-title leftpx="40" title="打印功能" slot="title"></x-title>
				</x-banner>
			</view>
			<view class="x-banner">
				<x-title leftpx="40" title="更多功能" slot="title"></x-title>
				<u-cell-group :border="false">
					<u-cell-item title="订单取件码" :border-bottom="true" @click="orderCode">
						<image slot="icon" src="../../static/index/order@2x.png" mode=""
							style="width: 44rpx;height: 46rpx;margin: 0rpx 22rpx 0rpx 20rpx;">
						</image>
					</u-cell-item>
					<!-- <u-cell-item title="设备导航">
						<image slot="icon" src="../../static/index/navigation@2x.png" mode=""
							style="width: 44rpx;height: 46rpx;margin: 0rpx 22rpx 0rpx 20rpx;">
						</image>
					</u-cell-item> -->
				</u-cell-group>
			</view>
			 
		</view>
		<!-- <u-tabbar :list="list" :iconSize=40 :mid-button="true" :before-switch="beforeSwitch"></u-tabbar> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				swiperList: [{
					ImageURL: '../../static/index/banner2.jpg'
				}],
				printList: [{
						// SPUId: 1000,//最原始的spu
						SPUId: 1014, //扫码的spu
						name: "文档上传打印",
						url: "../../static/index/file@2x.png"
						// url: "http://192.168.2.220:5000/Images/wechat/首页/file@2x.png"
					},

					{
						SPUId: 1005,
						name: "证卡打印",
						url: "../../static/index/idcard@2x.png"
						// url: "http://192.168.2.220:5000/Images/wechat/首页/idcard@2x.png"
					},


					{
						SPUId: 1003,
						name: "生活照打印",
						// url: "../../static/index/lifephoto@2x.png"
						url: "../../static/index/lifephoto@2x.png" //代替品
						// url: "http://192.168.2.220:5000/Images/wechat/首页/lifephoto@2x.png"
					},
					// {
					// 	SPUId: 1005,
					// 	name: "身份证打印",
					// 	url: "../../static/index/id@2x.png"
					// 	// url: "http://192.168.2.220:5000/Images/wechat/首页/id@2x.png" 
					// },
					{
						SPUId: 1008,
						name: "空白A4纸",
						// url: "../../static/index/a4@2x.png"原来的
						url: "../../static/index/a4@2x.png" //代替品
						// url: "http://192.168.2.220:5000/Images/wechat/首页/a4@2x.png"
					},
					// {
					// 	SPUId: 1007,
					// 	name: "模板打印",
					// 	url: "../../static/index/template@2x.png"
					// 	// url: "http://192.168.2.220:5000/Images/wechat/首页/template@2x.png"
					// },

					// 生活照打印和身份证打印换位置了
					// {
					// 	SPUId: 1005,
					// 	name: "身份证打印",
					// 	url: "../../static/index/id@2x.png"
					// 	// url: "http://192.168.2.220:5000/Images/wechat/首页/id@2x.png" 
					// },
					// {
					// 	SPUId: 1002,
					// 	name: "证件照打印",
					// 	url: "../../static/index/idphopo@2x.png"
					// 	// url: "http://192.168.2.220:5000/Images/wechat/首页/idphopo@2x.png"
					// },
					// {
					// 	SPUId: 7,
					// 	name: "广告投放",
					// 	url: "../../static/index/ad@2x.png"
					// 	// url: "http://192.168.2.220:5000/Images/wechat/首页/ad@2x.png"
					// },
				],
			}
		},
		onLoad() {
			this.list = this.$store.state.list
			this.qq()
		},

		methods: {
			qq() {
				qq.showShareMenu({
				  showShareItems: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']
				})
			},
			orderCode() {
				uni.navigateTo({
					url: '../../indexPackages/orderCode-print/orderCode-print'
				})
			},
			beforeSwitch(index) {
				console.log(index);
				return true
			},
			switchPrint(index) {
				switch (index) {
					case 0:
						uni.navigateTo({
							url: '../../indexPackages/uploadDocument-print/uploadDocument-print'
						})
						console.log('QQ打印');
						break;
					case 1:
						// 证卡打印
						uni.navigateTo({
							url: '../../indexPackages/idCard-print/idCard-print'
						})
						console.log('证卡打印');
						break;
					case 2:
						// 这里只是做了一个示范，
						uni.navigateTo({
							url: '../../indexPackages/lifePhone-Print/lifePhone-Print'
						})
						console.log('QQ打印');
						break;
					case 3:
						uni.showModal({
							title: '温馨提示',
							content: '空白A4纸请直接在设备购买',
							showCancel: false,
							success: (res) => {
								if (res.confirm) {

								}
							}
						})
						console.log('空白A4纸');
						break;
					case 4:
						console.log('模板打印');
						break;
					case 5:
						console.log('生活照&&证件照');
						break;
					case 6:
						console.log('生活照&&证件照');
						break;
					case 7:
						console.log('广告投放');
				}
			}
		}
	}
</script>

<style lang="scss">
	.top-box {
		/* border: 1px solid red; */
		height: 324rpx;
		width: 750rpx;
		position: relative;
		margin-bottom: 30rpx;
	}
</style>
